<!-- begin: main content area #main -->
<div id="main">
	<!-- begin: #col1 - first float column -->
	<div id="col1">
		<div id="col1_content" class="clearfix"> <a id="content" name="content"></a>
			<!-- skiplink anchor: Content -->
			<table class="full">
				<tbody>
				  <tr>
				    <td class="fieldSeparator" colspan="7">Orders</td>
				  </tr>
				  <tr>
				    <td colspan="6">
            The following are orders within the fastmount system under customer accounts. To view an order, click on the underlined link by order id. To search on orders click here</td>
            <td><style lang="text/css">
            			select {
            				font-size:10px;
            			}
            		</style>
    			<form action="/orders" method="get">
    				Change Sort Order:
    				<select id="sort_select" name="sort" onChange="sortOrdersList();">
    					<%= [['order_id', 'Invoice Number'], ['customer_name', 'Customer Name'],['country_name', 'Country Name'], ['status_name', 'Status']].collect do |set| 
    					      @sort_column == set[0] ? s = 'selected="selected"' : s = ''
    					        "<option value=\"#{set[0]}\" #{s}>#{set[1]}</option>" 
    					    end.join " \n" %>
    				</select>
    			</form></td>
    			
				  </tr>
					<%
					last_status = nil 
					for order in @orders %>
					<% if @sort_column == 'status_name' && order.status_name != last_status %>
					<tr>
						<td style="border-bottom: 1px solid grey" colspan="7"><strong><t><%= order.status_name %></strong></td>
					</tr>
					<% last_status = order.status_name
					  end %>
					<tr>
						<td><a href="/orders/<%= order.id %>"><%= order.id %></a></td>
						<td><%= order.created_at.to_s(:short) %></td>
						<td><%= order.customer_name %></td>
						<td><%= order.country_name %></td>
						<td>$USD <%= order.total_amount_pay_online %></td>
						<td style="color:grey"><%= order.status_name %></td>
					</tr>
					<% end %>
				</tbody>

			</table>
		</div>
	</div>
	<!-- end: #col1 -->
	<!-- begin: #col3 static column -->
	<div id="col3">
		<div id="col3_content" class="clearfix">
			<ul id="submenu">
				<li id="title">Actions</li>
				<li><a href="#">View current active</a></li>
				<li><a href="#">View archived</a></li>
				<li><a href="#">Search Orders</a></li>
				<li><a href="#">Create New Order</a></li>
			</ul>
		</div>
		<div id="ie_clearing">&nbsp;</div>
		<!-- End: IE Column Clearing -->
	</div>
	<!-- end: #col3 -->
</div>
<!-- end: #main -->